﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Xml.Serialization;
using Ppt = Microsoft.Office.Interop.PowerPoint;

namespace ObjectModel.PowerPoint.RulesModel
{
    public class ChangeColourAction : Action
    {
        public int Colour { get; set; }

        public override void Perform()
        {
            object target = Target.Resolve();

            if (target is Ppt.Series)
                ((Ppt.Series)target).Format.Line.ForeColor.RGB = Colour;

            else if (target is Ppt.Point)
                ((Ppt.Point)target).Format.Fill.ForeColor.RGB = Colour;
        }
    }
}
